<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>b.html</h1>

    <script src="./peerjs.min.js"></script>
    <script>
      const peer = new Peer("b-html", {
        host: "localhost",
        port: 9000,
        path: "/rtc",
      });
      const conn = peer.connect("a-html");
      conn.on("open", function () {
        // here you have conn.id
        conn.send("hi!");
      });
    </script>
  </body>
</html>
